﻿using System.Data;
using YAKEJI.Abp.Database;
using YAPACS.BusinessObjects.Exams;
using YAPACS.BusinessObjects.Managements.Exams;

namespace YAPACS.RisServer.Abstractions;

public interface ICommonUse
{
    /// <summary>
    /// DateTime转化为秒时间戳
    /// </summary>
    /// <param name="dateTime"></param>
    /// <returns></returns>
    long DateTimeToUnixTimestampSeconds(DateTime dateTime);

    /// <summary>
    /// PatientSex枚举值，转化为 Applicable枚举值
    /// </summary>
    /// <param name="sex"></param>
    /// <returns></returns>
    ApplicableSex PatientSexToApplicableSex(PatientSex sex);

    /// <summary>
    /// 获取周一日期(ISO)
    /// </summary>
    /// <param name="dateTime">传入时间</param>
    /// <returns></returns>
    DateTime MondayDateOfISOWeek(DateTime dateTime);

    /// <summary>
    /// 创建并返回Dapper链接
    /// </summary>
    /// <returns></returns>
    IDbConnection GetDapperConnection(out DatabaseType databaseType);
}
